<?php

require_once(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'modules'
        . DIRECTORY_SEPARATOR . 'cms'
        . DIRECTORY_SEPARATOR . 'public'
        . DIRECTORY_SEPARATOR . 'models'
        . DIRECTORY_SEPARATOR . 'CmsDeal.php');

class Zend_View_Helper_SoldDealModule {

    public $view;

    public function setView($view) {
        $this->view = $view;
    }

    public function soldDealModule($position, $index = 0) {
        $this->view->addScriptPath(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'modules'
                . DIRECTORY_SEPARATOR . 'cms'
                . DIRECTORY_SEPARATOR . 'public'
                . DIRECTORY_SEPARATOR . 'views'
                . DIRECTORY_SEPARATOR . 'scripts');

        $model = new CmsDeal();
        $this->view->deals = $model->getSoldDeals(0, 3);
        $this->view->index = $index;
        $this->view->placeholder($position)->captureStart();
        echo $this->view->render('sold_deal.phtml');
        $this->view->placeholder($position)->captureEnd();
    }

}